/*
 * This file is part of Movie Browser.
 *
 * Copyright (C) Francis De Brabandere
 *
 * Movie Browser is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Movie Browser is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package eu.somatik.moviebrowser.gui;

import com.flicklib.domain.MovieSearchResult;
import com.flicklib.domain.MovieService;
import eu.somatik.moviebrowser.domain.StorableMovieFile;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableColumnModel;

/**
 *
 * @author zsombor
 */
public class ImportDialog extends javax.swing.JDialog {

    private ImportDialogController controller;

    /** Creates new form ImportDialog */
    public ImportDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        initTableSizes();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        importFolderTextField = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        deviceLabelTextField = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        moveiPathTextField = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        relatedFilesTable = new javax.swing.JTable();
        jLabel5 = new javax.swing.JLabel();
        movieTitleTextField = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        siteSelectorComboBox = new javax.swing.JComboBox();
        searchButton = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        suggestedTitlesScrollPane = new javax.swing.JScrollPane();
        suggestedTitlesList = new javax.swing.JList();
        selectionProgressBar = new javax.swing.JProgressBar();
        jPanel3 = new javax.swing.JPanel();
        prevButton = new javax.swing.JButton();
        nextButton = new javax.swing.JButton();
        removeButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();
        acceptButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Importing folder");
        setIconImage(null);
        setModal(true);

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel1.setText("Import folder:");

        importFolderTextField.setEditable(false);

        jLabel2.setText("Label of the folder:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(importFolderTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 536, Short.MAX_VALUE)
                    .addComponent(deviceLabelTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 536, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(importFolderTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(deviceLabelTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel3.setText("Path to movie:");

        moveiPathTextField.setEditable(false);

        jLabel4.setText("Related files :");

        relatedFilesTable.setModel(new MovieFileTable());
        jScrollPane1.setViewportView(relatedFilesTable);

        jLabel5.setText("Movie Title:");

        movieTitleTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                movieTitleTextFieldActionPerformed(evt);
            }
        });

        jLabel6.setText("Web Site:");

        siteSelectorComboBox.setModel(getMovieServices());

        searchButton.setText("Find");
        searchButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchButtonActionPerformed(evt);
            }
        });

        jLabel7.setText("Suggested Titles:");

        suggestedTitlesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        suggestedTitlesList.setCellRenderer(new MovieListCellRenderer());
        suggestedTitlesList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                suggestedTitlesListValueChanged(evt);
            }
        });
        suggestedTitlesScrollPane.setViewportView(suggestedTitlesList);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(selectionProgressBar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 675, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6)
                            .addComponent(jLabel7))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(suggestedTitlesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addComponent(siteSelectorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 314, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(searchButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addComponent(movieTitleTextField)
                                .addComponent(moveiPathTextField)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE)))))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(moveiPathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(23, 23, 23)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(movieTitleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(siteSelectorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(searchButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(suggestedTitlesScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(selectionProgressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        prevButton.setText("Previous");
        prevButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                prevButtonActionPerformed(evt);
            }
        });

        nextButton.setText("Next");
        nextButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nextButtonActionPerformed(evt);
            }
        });

        removeButton.setText("Remove");
        removeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeButtonActionPerformed(evt);
            }
        });

        cancelButton.setText("Cancel All");
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });

        acceptButton.setText("Accept All");
        acceptButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                acceptButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(208, Short.MAX_VALUE)
                .addComponent(prevButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(nextButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(removeButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cancelButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(acceptButton)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(acceptButton)
                    .addComponent(cancelButton)
                    .addComponent(removeButton)
                    .addComponent(nextButton)
                    .addComponent(prevButton))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(24, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        controller.cancelPressed();
}//GEN-LAST:event_cancelButtonActionPerformed

    private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed
        controller.searchPressed();
}//GEN-LAST:event_searchButtonActionPerformed

    private void prevButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_prevButtonActionPerformed
        controller.prevButtonPressed();
    }//GEN-LAST:event_prevButtonActionPerformed

    private void nextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextButtonActionPerformed
        controller.nextButtonPressed();
    }//GEN-LAST:event_nextButtonActionPerformed

    private void acceptButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acceptButtonActionPerformed
        controller.okButtonPressed();
    }//GEN-LAST:event_acceptButtonActionPerformed

    private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed
        controller.removeButtonPressed();
    }//GEN-LAST:event_removeButtonActionPerformed

    private void suggestedTitlesListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_suggestedTitlesListValueChanged
        if(!evt.getValueIsAdjusting() && suggestedTitlesList.getSelectedIndex() != -1){
            int firstIndex = evt.getFirstIndex();
            int lastIndex = evt.getLastIndex();
            boolean isAdjusting = evt.getValueIsAdjusting();
//            System.out.append("Event for indexes " + firstIndex + " - " + lastIndex + "; isAdjusting is " + isAdjusting + "; selected indexe: " + suggestedTitlesList.getSelectedIndex());
//            System.out.println();
            controller.selectionChanged();
        }
    }//GEN-LAST:event_suggestedTitlesListValueChanged

    private void movieTitleTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_movieTitleTextFieldActionPerformed
        controller.searchPressed();
    }//GEN-LAST:event_movieTitleTextFieldActionPerformed

    
    public void setController(ImportDialogController controller) {
        this.controller = controller;
    }

    public void setMovieService(MovieService movieService){
        siteSelectorComboBox.setSelectedItem(movieService);
    }

    public String getFolderLabel() {
        return this.deviceLabelTextField.getText();
    }

    public void setFolderLabel(String value) {
        this.deviceLabelTextField.setText(value);
    }

    public void setImportFolderPath(String value) {
        this.importFolderTextField.setText(value);
    }

    public String getImportFolderPath() {
        return this.importFolderTextField.getText();
    }

    public void setPathToMovie(String path) {
        this.moveiPathTextField.setText(path);
    }

    public void setMovieTitle(String title) {
        this.movieTitleTextField.setText(title);
    }

    public String getMovieTitle() {
        return this.movieTitleTextField.getText();
    }

    public void setRelatedFiles(Collection<StorableMovieFile> files) {
        ((MovieFileTable)this.relatedFilesTable.getModel()).setFiles(new ArrayList<StorableMovieFile>(files));
        //this.relatedFilesList.setModel(listModel);
    }

    public void setMovieSuggestions(List<? extends MovieSearchResult> result) {
        DefaultListModel listModel = new DefaultListModel();
        if (result!=null) {
            for (MovieSearchResult movie : result) {
                listModel.addElement(movie);
            }
        }
        this.suggestedTitlesList.setModel(listModel);
    }

    public void clearMovieSuggestions() {
        this.suggestedTitlesList.getSelectionModel().clearSelection();
        /*if (model instanceof DefaultListModel) {
            ((DefaultListModel)model).clear();
        } else {
            System.err.println("MODEL : " +model);
        }*/
    }

   private ComboBoxModel getMovieServices() {
        return new DefaultComboBoxModel(SettingsDialog.MAIN_SERVICES);
   }

   public void setSelectedMovieService(MovieService service) {
       this.siteSelectorComboBox.setSelectedItem(service);
   }


   public MovieService getSelectedMovieService() {
       return (MovieService) this.siteSelectorComboBox.getSelectedItem();
   }

   public void setSelectedMovie(MovieSearchResult movie) {
       this.suggestedTitlesList.setSelectedValue(movie, true);
   }

    public MovieSearchResult getSelectedMovie() {
        return (MovieSearchResult) this.suggestedTitlesList.getSelectedValue();
    }

    public void setEnablePrevButton(boolean flag) {
        this.prevButton.setEnabled(flag);
    }
    public void setEnableNextButton(boolean flag) {
        this.nextButton.setEnabled(flag);
    }
    
    public void setEnableSearch(boolean flag) {
        this.searchButton.setEnabled(flag);
        this.movieTitleTextField.setEnabled(flag);
        this.siteSelectorComboBox.setEnabled(flag);
    }

    public void setProgressBar(int current, int max) {
        this.selectionProgressBar.setMaximum(max);
        this.selectionProgressBar.setMinimum(0);
        this.selectionProgressBar.setValue(current);
    }

    public void showMessageDialog(String message,String title) {
        JOptionPane.showMessageDialog(getParent(), message, title, JOptionPane.WARNING_MESSAGE);
    }

    final static int TYPE = 0;
    final static int NAME = 1;
    final static int SIZE = 2;;

    void initTableSizes() {
        TableColumnModel model = this.relatedFilesTable.getColumnModel();
        model.getColumn(TYPE).setPreferredWidth(80);
        model.getColumn(TYPE).setResizable(false);
        model.getColumn(TYPE).setMaxWidth(80);
        model.getColumn(NAME).setResizable(true);
        model.getColumn(SIZE).setResizable(false);
        model.getColumn(SIZE).setPreferredWidth(120);
        model.getColumn(SIZE).setMaxWidth(120);
    }

    static class MovieFileTable extends AbstractTableModel {

        List<StorableMovieFile> files = Collections.EMPTY_LIST;;

        public void setFiles(List<StorableMovieFile> files) {
            this.files = files;
            fireTableDataChanged();
        }

        @Override
        public int getRowCount() {
            return files.size();
        }

        @Override
        public int getColumnCount() {
            return 3;
        }

        @Override
        public Object getValueAt(int rowIndex, int columnIndex) {
            StorableMovieFile file = files.get(rowIndex);
            switch (columnIndex) {
                case TYPE : return file.getType().getLabel();
                case NAME : return file.getName();
                case SIZE : return file.getSize();
            }
            return null;
        }

        @Override
        public String getColumnName(int column) {
            switch (column) {
                case TYPE : return "Type";
                case NAME : return "Name";
                case SIZE : return "Size";
            }
            return null;
        }

        @Override
        public Class<?> getColumnClass(int columnIndex) {
            switch (columnIndex) {
                case TYPE : return String.class;
                case NAME : return String.class;
                case SIZE : return Long.class;
            }
            return null;
        }





    }

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton acceptButton;
    private javax.swing.JButton cancelButton;
    private javax.swing.JTextField deviceLabelTextField;
    private javax.swing.JTextField importFolderTextField;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField moveiPathTextField;
    private javax.swing.JTextField movieTitleTextField;
    private javax.swing.JButton nextButton;
    private javax.swing.JButton prevButton;
    private javax.swing.JTable relatedFilesTable;
    private javax.swing.JButton removeButton;
    private javax.swing.JButton searchButton;
    private javax.swing.JProgressBar selectionProgressBar;
    private javax.swing.JComboBox siteSelectorComboBox;
    private javax.swing.JList suggestedTitlesList;
    private javax.swing.JScrollPane suggestedTitlesScrollPane;
    // End of variables declaration//GEN-END:variables

}
